<template>
  <section id="recordCount">
    <el-row style="line-height: 30px;padding-bottom: 10px;">
      <el-col :span="5" class='flex'>
        <span style='white-space:nowrap '>盈亏时间：</span>
        <div class="block" style="flex: 1">
          <el-date-picker
            v-model="value1"
            type="datetime"
            placeholder="选择日期时间">
          </el-date-picker>
        </div>
      </el-col>
      <el-col :span="5" class='flex'>
        <span style='white-space:nowrap;padding: 0 8px'>至</span>
        <div class="block" style="flex: 1">
          <el-date-picker
            v-model="value1"
            type="datetime"
            placeholder="选择日期时间">
          </el-date-picker>
        </div>
      </el-col>


      <el-col :span="4" style="text-align: left;padding-left: 10px">
        <el-button type="primary" size="mini">查询</el-button>
      </el-col>
    </el-row>

    <el-table :data="params" stripe style="width: 100%">
      <el-table-column prop="createTime" label="日期" width="180">
      </el-table-column>
      <el-table-column prop="nickName" label="姓名" width="180">
      </el-table-column>
      <el-table-column prop="businessName" label="支付方式">
      </el-table-column>
    </el-table>
  </section>
</template>

<script>
	import judgeTime from '../../../../assets/js/index.js'
  export default {
    data () {
      return {
        value1: '',
        params: [],
        options: [{
          value: '选项1',
          label: '黄金糕'
        }, {
          value: '选项2',
          label: '双皮奶'
        }, {
          value: '选项3',
          label: '蚵仔煎'
        }, {
          value: '选项4',
          label: '龙须面'
        }, {
          value: '选项5',
          label: '北京烤鸭'
        }],
        value: '',
        tableData: [{
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }]
      }
    },
    created: function () {
      console.log(121)
      this.getTableData()
    },
    methods: {
    	getTableData: function () {
 				this.$api.test().then(res => {
			    this.params = res.data.list
			    
			    for(let i = 0; i < this.params.length; i++) {
			    	this.params[i].createTime = judgeTime(this.params[i].createTime)
			    	console.log(this.params[i].createTime)
			    }
        })
      }
    }

  }
</script>

<style lang="less">
  #recordCount{

    .el-input__inner{
      height: 30px;
      line-height: 30px;
      width: 100%;
      padding-right: 0;
      font-size: 12px;
      padding-left: 20px;
    }
    .el-input{
      width: 100%!important;
    }
    .el-input__icon{
      line-height: inherit;
      width: 0;
    }
    .el-input__suffix{
      right: 20px;
    }
  }
</style>
